package com.example.service.Impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.mapper.OperateLogMapper;
import com.example.pojo.entity.OperateLog;
import com.example.service.OperateLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * TODO
 *
 * @author ding
 * @since 2024/6/26
 */
@Service
@DS("master")
public class OperateLogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLog> implements OperateLogService {

    @Autowired
    private OperateLogMapper operateLogMapper;

    /**
     * 插入新日志
     */
    public void insertLog(OperateLog operateLog) {
        if (!operateLog.getParams().equals("{}")){
            operateLogMapper.insert(operateLog);
        }
    }
}
